import { axios } from '@/utils/request'

/**
 * 查询销售订单
 *
 * @author Eric
 * @date 2021-04-04 08:55:37
 */
export function saleOrderPage (parameter) {
  return axios({
    url: '/saleOrder/page',
    method: 'get',
    params: parameter
  })
}

/**
 * 销售订单列表
 *
 * @author Eric
 * @date 2021-04-04 08:55:37
 */
export function saleOrderList (parameter) {
  return axios({
    url: '/saleOrder/list',
    method: 'get',
    params: parameter
  })
}

/**
 * 添加销售订单
 *
 * @author Eric
 * @date 2021-04-04 08:55:37
 */
export function saleOrderAdd (parameter) {
  return axios({
    url: '/saleOrder/add',
    method: 'post',
    data: parameter
  })
}

/**
 * 编辑销售订单
 *
 * @author Eric
 * @date 2021-04-04 08:55:37
 */
export function saleOrderEdit (parameter) {
  return axios({
    url: '/saleOrder/edit',
    method: 'post',
    data: parameter
  })
}

/**
 * 删除销售订单
 *
 * @author Eric
 * @date 2021-04-04 08:55:37
 */
export function saleOrderDelete (parameter) {
  return axios({
    url: '/saleOrder/delete',
    method: 'post',
    data: parameter
  })
}

/**
 * 查询销售订单详情
 *
 * @author Eric
 * @date 2021-04-04 08:55:37
 */
export function saleOrderDetail (code) {
  return axios({
    url: '/saleOrder/detail',
    method: 'get',
    params: { code: code }
  })
}

/**
 * 统计业绩
 *
 * @author Eric
 * @date 2021-04-04 08:55:37
 */
export function statisticsAchievement (parameter) {
  return axios({
    url: '/saleOrder/statisticsAchievement',
    method: 'get',
    params: parameter
  })
}

/**
 * 统计热销产品
 *
 * @author Eric
 * @date 2021-04-04 08:55:37
 */
export function statisticsHotMaterial (parameter) {
  return axios({
    url: '/saleOrder/statisticsHotMaterial',
    method: 'get',
    params: parameter
  })
}

/**
 * 统计客户
 *
 * @author Eric
 * @date 2021-04-04 08:55:37
 */
export function statisticsCustomer (parameter) {
  return axios({
    url: '/saleOrder/statisticsCustomer',
    method: 'get',
    params: parameter
  })
}
